<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>缴费记录</title>
	<link rel="stylesheet" type="text/css" href="../common/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../common/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../common/demo.css">
	<script type="text/javascript" src="../common/jquery.min.js"></script>
	<script type="text/javascript" src="../common/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../common/common.js"></script>
	<script type="text/javascript" src="../common/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>

<table id="dg" title="缴费记录" style="width: 99%;height:630px"
	   data-options="rownumbers:true,
						singleSelect:true,
						autoRowHeight:true,
						pagination:true,
						pageSize:20,
						url:'/manage/cost/list',
						method:'get',
						toolbar:'#tb'">
	<thead>
	<tr>
		<th data-options="field:'id',width:100,hidden:'true'">id</th>
		<th data-options="field:'chargeType',width:100">缴费类型</th>
		<th data-options="field:'money',width:100">缴费金额</th>
		<th data-options="field:'floorId',width:100">楼号</th>
		<th data-options="field:'unitId',width:100">单元号</th>
		<th data-options="field:'roomId',width:100">房间号</th>
		<th data-options="field:'createTime',width:190,align:'center',
					formatter: function (createTime, row, index) {
			       var datetime = dateFormatter(createTime); <!--value就是数据库具体的值-->
			       return datetime;
			    }">缴费时间</th>
	</tr>
	</thead>
</table>
<div id="tb" style="padding:2px 5px;">
	缴费类型:
	<select id="chargeType" class="easyui-combobox" panelHeight="auto" style="width:100px">
		<option value="">全部</option>
		<option value="物业费">物业费</option>
		<option value="水费">水费</option>
		<option value="电费">电费</option>
		<option value="车位管理费">车位管理费</option>
		<option value="宽带费">宽带费</option>
	</select>
	<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="searchA()">Search</a>
</div>
</body>
<script type="text/javascript">
	$(function(){
		searchA();
	})
	function searchA(){
		var userId = localStorage.getItem("userId");
		var chargeType = $('#chargeType').val();
		var data = {
				userId:userId,
				chargeType:chargeType
		};
		var pager = $('#dg').datagrid({
			queryParams: data,
			//双击事件
			onDblClickRow :function(rowIndex,rowData){
				}
		}).datagrid('getPager');	// get the pager of datagrid
		pager.pagination({
			buttons:[{
				iconCls:'icon-edit',
				handler:function(){
					getSelected();
				}
			}]
		});
		pager.pagination().find('a.l-btn').tooltip({
			content: function(){
				var cc = $(this).find('span.l-btn-icon').attr('class').split(' ');
				var icon = cc[1].split('-')[1];
				return icon + ' page';
			}
		});
	}
	</script>
</html>